.class public Les/j9;
.super Ljava/lang/Object;
.source "MediaMuxerWrapper.java"


# annotations
.annotation build Landroid/annotation/TargetApi;
    value = 0x15
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/j9$b;
    }
.end annotation


# instance fields
.field private A:J

.field private B:J

.field private C:Les/l9$h;

.field private a:Z

.field private b:Z

.field private c:Les/h9;

.field private d:J

.field private e:Z

.field private f:I

.field private g:I

.field private h:I

.field private i:Z

.field private volatile j:Z

.field private k:Les/l9;

.field private l:Les/l9;

.field private m:I

.field private n:Les/j9$b;

.field private o:J

.field private p:J

.field private q:J

.field private r:J

.field private s:Z

.field private t:Ljava/lang/String;

.field private u:Ljava/lang/String;

.field private v:Z

.field private w:Z

.field private x:Ljava/lang/Exception;

.field private final y:Ljava/lang/Object;

.field private z:Z


# direct methods
.method public constructor <init>(Les/j9$b;)V
    .locals 4

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Les/j9;->a:Z

    const/4 v1, 0x1

    .line 3
    iput-boolean v1, p0, Les/j9;->b:Z

    const-wide/16 v2, 0x0

    .line 4
    iput-wide v2, p0, Les/j9;->d:J

    .line 5
    iput-boolean v0, p0, Les/j9;->e:Z

    .line 6
    iput v0, p0, Les/j9;->m:I

    const-wide/16 v2, -0x1

    .line 7
    iput-wide v2, p0, Les/j9;->o:J

    .line 8
    iput-wide v2, p0, Les/j9;->p:J

    .line 9
    iput-wide v2, p0, Les/j9;->q:J

    .line 10
    iput-wide v2, p0, Les/j9;->r:J

    .line 11
    iput-boolean v1, p0, Les/j9;->s:Z

    .line 12
    iput-boolean v0, p0, Les/j9;->w:Z

    const/4 v1, 0x0

    .line 13
    iput-object v1, p0, Les/j9;->x:Ljava/lang/Exception;

    .line 14
    new-instance v1, Ljava/lang/Object;

    invoke-direct {v1}, Ljava/lang/Object;-><init>()V

    iput-object v1, p0, Les/j9;->y:Ljava/lang/Object;

    .line 15
    iput-boolean v0, p0, Les/j9;->z:Z

    .line 16
    iput-wide v2, p0, Les/j9;->A:J

    .line 17
    iput-wide v2, p0, Les/j9;->B:J

    .line 18
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 19
    new-instance v1, Les/j9$a;

    invoke-direct {v1, p0}, Les/j9$a;-><init>(Les/j9;)V

    iput-object v1, p0, Les/j9;->C:Les/l9$h;

    if-eqz p1, :cond_0

    .line 20
    iput v0, p0, Les/j9;->g:I

    iput v0, p0, Les/j9;->f:I

    .line 21
    iput-boolean v0, p0, Les/j9;->i:Z

    .line 22
    iput-object p1, p0, Les/j9;->n:Les/j9$b;

    return-void

    .line 23
    :cond_0
    new-instance p1, Ljava/lang/NullPointerException;

    const-string v0, "MediaMuxerListener is null"

    invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method private declared-synchronized a(Landroid/media/MediaFormat;)I
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalStateException;
        }
    .end annotation

    monitor-enter p0

    .line 36
    :try_start_0
    iget-boolean v0, p0, Les/j9;->i:Z

    if-nez v0, :cond_1

    .line 37
    iget-object v0, p0, Les/j9;->c:Les/h9;

    if-eqz v0, :cond_0

    iget-object v0, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v0, p1}, Les/h9;->a(Landroid/media/MediaFormat;)I

    move-result v0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    const-string v1, "MediaMuxerWrapper"

    .line 38
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "addTrack:trackNum="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v3, p0, Les/j9;->f:I

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v3, ",trackIx="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v3, ",format="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {v1, p1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 39
    monitor-exit p0

    return v0

    .line 40
    :cond_1
    :try_start_1
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string v0, "muxer already started"

    invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method static synthetic a(Les/j9;Landroid/media/MediaFormat;)I
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalStateException;
        }
    .end annotation

    .line 5
    invoke-direct {p0, p1}, Les/j9;->a(Landroid/media/MediaFormat;)I

    move-result p0

    return p0
.end method

.method private declared-synchronized a(ILjava/nio/ByteBuffer;Landroid/media/MediaCodec$BufferInfo;)V
    .locals 7

    monitor-enter p0

    .line 41
    :try_start_0
    iget-boolean v0, p0, Les/j9;->i:Z

    if-eqz v0, :cond_7

    iget-object v0, p0, Les/j9;->c:Les/h9;

    if-eqz v0, :cond_7

    iget-object v0, p0, Les/j9;->x:Ljava/lang/Exception;

    if-nez v0, :cond_7

    .line 42
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    invoke-direct {p0, p1, v0, v1}, Les/j9;->a(IJ)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 43
    iget-object v0, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v0, p1, p2, p3}, Les/h9;->a(ILjava/nio/ByteBuffer;Landroid/media/MediaCodec$BufferInfo;)V

    .line 44
    :cond_0
    iget-object p2, p0, Les/j9;->k:Les/l9;

    const-wide/16 v0, -0x1

    const/4 v2, 0x1

    const-wide/16 v3, 0x3e8

    if-eqz p2, :cond_2

    iget-object p2, p0, Les/j9;->k:Les/l9;

    invoke-virtual {p2}, Les/l9;->f()I

    move-result p2

    if-ne p1, p2, :cond_2

    .line 45
    iget-wide v5, p0, Les/j9;->o:J

    cmp-long p2, v5, v0

    if-nez p2, :cond_1

    .line 46
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    iput-wide v0, p0, Les/j9;->o:J

    .line 47
    iget p2, p0, Les/j9;->m:I

    add-int/2addr p2, v2

    iput p2, p0, Les/j9;->m:I

    const-string p2, "MediaMuxerWrapper"

    .line 48
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "first video pts:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v1, p0, Les/j9;->o:J

    div-long/2addr v1, v3

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {p2, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 49
    :cond_1
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    iput-wide v0, p0, Les/j9;->B:J

    .line 50
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    iget-wide v5, p0, Les/j9;->o:J

    sub-long/2addr v0, v5

    div-long/2addr v0, v3

    .line 51
    iget-wide v2, p0, Les/j9;->q:J

    cmp-long p2, v0, v2

    if-eqz p2, :cond_4

    .line 52
    iput-wide v0, p0, Les/j9;->q:J

    .line 53
    iget-object p2, p0, Les/j9;->n:Les/j9$b;

    const/4 v2, 0x0

    invoke-interface {p2, v0, v1, v2}, Les/j9$b;->a(JZ)V

    goto :goto_0

    .line 54
    :cond_2
    iget-object p2, p0, Les/j9;->l:Les/l9;

    if-eqz p2, :cond_4

    iget-object p2, p0, Les/j9;->l:Les/l9;

    invoke-virtual {p2}, Les/l9;->f()I

    move-result p2

    if-ne p1, p2, :cond_4

    .line 55
    iget-wide v5, p0, Les/j9;->p:J

    cmp-long p2, v5, v0

    if-nez p2, :cond_3

    .line 56
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    iput-wide v0, p0, Les/j9;->p:J

    .line 57
    iget p2, p0, Les/j9;->m:I

    add-int/2addr p2, v2

    iput p2, p0, Les/j9;->m:I

    const-string p2, "MediaMuxerWrapper"

    .line 58
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "first audio pts:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v5, p0, Les/j9;->p:J

    div-long/2addr v5, v3

    invoke-virtual {v0, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {p2, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 59
    :cond_3
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    iput-wide v0, p0, Les/j9;->A:J

    .line 60
    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    iget-wide v5, p0, Les/j9;->p:J

    sub-long/2addr v0, v5

    div-long/2addr v0, v3

    .line 61
    iget-wide v3, p0, Les/j9;->r:J

    cmp-long p2, v0, v3

    if-eqz p2, :cond_4

    .line 62
    iput-wide v0, p0, Les/j9;->r:J

    .line 63
    iget-object p2, p0, Les/j9;->n:Les/j9$b;

    invoke-interface {p2, v0, v1, v2}, Les/j9$b;->a(JZ)V

    .line 64
    :cond_4
    :goto_0
    iget-boolean p2, p0, Les/j9;->z:Z

    if-eqz p2, :cond_7

    iget p2, p0, Les/j9;->m:I

    iget v0, p0, Les/j9;->f:I

    if-ne p2, v0, :cond_7

    .line 65
    invoke-virtual {p0}, Les/j9;->b()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto/16 :goto_2

    :catchall_0
    move-exception p1

    goto/16 :goto_3

    :catch_0
    move-exception p2

    :try_start_1
    const-string v0, "MediaMuxerWrapper"

    .line 66
    invoke-virtual {p2}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "mux error"

    .line 67
    iget-object v1, p0, Les/j9;->k:Les/l9;

    if-eqz v1, :cond_5

    iget-object v1, p0, Les/j9;->k:Les/l9;

    invoke-virtual {v1}, Les/l9;->f()I

    move-result v1

    if-ne p1, v1, :cond_5

    .line 68
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "video mux error: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-boolean v0, p0, Les/j9;->i:Z

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    const-string v0, " "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    invoke-virtual {p1, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v0, " "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget p3, p3, Landroid/media/MediaCodec$BufferInfo;->flags:I

    invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p3, " "

    invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v0, p0, Les/j9;->B:J

    invoke-virtual {p1, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string p3, " "

    invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v0, p0, Les/j9;->q:J

    invoke-virtual {p1, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string p1, "MediaMuxerWrapper"

    .line 69
    invoke-static {p1, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 70
    :cond_5
    iget-object v1, p0, Les/j9;->l:Les/l9;

    if-eqz v1, :cond_6

    iget-object v1, p0, Les/j9;->l:Les/l9;

    invoke-virtual {v1}, Les/l9;->f()I

    move-result v1

    if-ne p1, v1, :cond_6

    .line 71
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "audio mux error: "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-boolean v0, p0, Les/j9;->i:Z

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    const-string v0, " "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v0, p3, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J

    invoke-virtual {p1, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v0, " "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget p3, p3, Landroid/media/MediaCodec$BufferInfo;->flags:I

    invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p3, " "

    invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v0, p0, Les/j9;->A:J

    invoke-virtual {p1, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string p3, " "

    invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v0, p0, Les/j9;->r:J

    invoke-virtual {p1, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string p1, "MediaMuxerWrapper"

    .line 72
    invoke-static {p1, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 73
    :cond_6
    :goto_1
    new-instance p1, Ljava/lang/Exception;

    invoke-direct {p1, v0, p2}, Ljava/lang/Exception;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    invoke-direct {p0, p1}, Les/j9;->a(Ljava/lang/Exception;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 74
    :cond_7
    :goto_2
    monitor-exit p0

    return-void

    :goto_3
    monitor-exit p0

    throw p1
.end method

.method private a(Lcom/esfile/screen/recorder/media/util/l;)V
    .locals 3

    .line 84
    iget v0, p1, Lcom/esfile/screen/recorder/media/util/l;->e:I

    iget-object v1, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    iget-object v2, p1, Lcom/esfile/screen/recorder/media/util/l;->f:Landroid/media/MediaCodec$BufferInfo;

    invoke-direct {p0, v0, v1, v2}, Les/j9;->a(ILjava/nio/ByteBuffer;Landroid/media/MediaCodec$BufferInfo;)V

    .line 85
    invoke-virtual {p1}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    return-void
.end method

.method static synthetic a(Les/j9;Lcom/esfile/screen/recorder/media/util/l;)V
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Les/j9;->a(Lcom/esfile/screen/recorder/media/util/l;)V

    return-void
.end method

.method static synthetic a(Les/j9;Ljava/lang/Exception;)V
    .locals 0

    .line 4
    invoke-direct {p0, p1}, Les/j9;->a(Ljava/lang/Exception;)V

    return-void
.end method

.method static synthetic a(Les/j9;Z)V
    .locals 0

    .line 3
    invoke-direct {p0, p1}, Les/j9;->b(Z)V

    return-void
.end method

.method private a(Ljava/lang/Exception;)V
    .locals 1

    .line 81
    iget-object v0, p0, Les/j9;->x:Ljava/lang/Exception;

    if-nez v0, :cond_0

    .line 82
    iput-object p1, p0, Les/j9;->x:Ljava/lang/Exception;

    .line 83
    invoke-virtual {p0}, Les/j9;->e()V

    :cond_0
    return-void
.end method

.method private a(IJ)Z
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    .line 75
    iget-object v0, p0, Les/j9;->k:Les/l9;

    const-string v1, " < lastTimestampUs "

    const-string v2, "timestampUs "

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Les/l9;->f()I

    move-result v0

    if-ne p1, v0, :cond_1

    .line 76
    iget-wide v3, p0, Les/j9;->B:J

    cmp-long p1, p2, v3

    if-ltz p1, :cond_0

    goto :goto_0

    .line 77
    :cond_0
    new-instance p1, Ljava/lang/IllegalArgumentException;

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide p2, p0, Les/j9;->B:J

    invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string p2, " for Video track"

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 78
    :cond_1
    iget-object v0, p0, Les/j9;->l:Les/l9;

    if-eqz v0, :cond_3

    invoke-virtual {v0}, Les/l9;->f()I

    move-result v0

    if-ne p1, v0, :cond_3

    .line 79
    iget-wide v3, p0, Les/j9;->A:J

    cmp-long p1, p2, v3

    if-ltz p1, :cond_2

    :goto_0
    const/4 p1, 0x1

    return p1

    .line 80
    :cond_2
    new-instance p1, Ljava/lang/IllegalArgumentException;

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide p2, p0, Les/j9;->A:J

    invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string p2, " for Audio track"

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1

    :cond_3
    const/4 p1, 0x0

    return p1
.end method

.method static synthetic a(Les/j9;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Les/j9;->i:Z

    return p0
.end method

.method private b(Ljava/lang/String;)Ljava/lang/String;
    .locals 5

    .line 2
    iget-object v0, p0, Les/j9;->k:Les/l9;

    const-string v1, "_"

    const-string v2, ""

    if-eqz v0, :cond_0

    .line 3
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, "_vi_"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Les/j9;->k:Les/l9;

    invoke-virtual {v2}, Les/l9;->g()I

    move-result v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Les/j9;->k:Les/l9;

    invoke-virtual {v2}, Les/l9;->d()I

    move-result v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Les/j9;->k:Les/l9;

    .line 4
    invoke-virtual {v2}, Les/l9;->c()I

    move-result v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 5
    :cond_0
    iget-object v0, p0, Les/j9;->l:Les/l9;

    if-eqz v0, :cond_1

    .line 6
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, "_au_"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Les/j9;->l:Les/l9;

    invoke-virtual {v2}, Les/l9;->e()I

    move-result v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Les/j9;->l:Les/l9;

    .line 7
    invoke-virtual {v1}, Les/l9;->b()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 8
    :cond_1
    invoke-static {p1}, Lcom/esfile/screen/recorder/media/util/r;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 9
    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/lang/String;)Z

    .line 10
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 11
    invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object p1

    .line 12
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v3, 0x0

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v4

    add-int/lit8 v4, v4, -0x4

    invoke-virtual {p1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string p1, ".rec"

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    .line 13
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    sget-object v0, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method private declared-synchronized b(Z)V
    .locals 3

    monitor-enter p0

    const/4 v0, 0x0

    if-nez p1, :cond_0

    .line 31
    :try_start_0
    iput-object v0, p0, Les/j9;->k:Les/l9;

    goto :goto_0

    .line 32
    :cond_0
    iput-object v0, p0, Les/j9;->l:Les/l9;

    .line 33
    :goto_0
    iget-object p1, p0, Les/j9;->k:Les/l9;

    if-nez p1, :cond_3

    iget-object p1, p0, Les/j9;->l:Les/l9;

    if-nez p1, :cond_3

    const-string p1, "MediaMuxerWrapper"

    const-string v1, "softStop release!!!!!!"

    .line 34
    invoke-static {p1, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 35
    iget-object p1, p0, Les/j9;->c:Les/h9;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    if-eqz p1, :cond_3

    .line 36
    :try_start_1
    iget-object p1, p0, Les/j9;->c:Les/h9;

    invoke-virtual {p1}, Les/h9;->a()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 37
    :goto_1
    :try_start_2
    iput-object v0, p0, Les/j9;->c:Les/h9;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    goto :goto_2

    :catchall_0
    move-exception p1

    goto :goto_3

    :catch_0
    move-exception p1

    :try_start_3
    const-string v1, "MediaMuxerWrapper"

    const-string v2, "failed release muxer"

    .line 38
    invoke-static {v1, v2, p1}, Lcom/esfile/screen/recorder/media/util/k;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_1

    .line 39
    :goto_2
    :try_start_4
    iget-object p1, p0, Les/j9;->t:Ljava/lang/String;

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p1

    if-eqz p1, :cond_1

    const-string p1, "test softStop"

    .line 40
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "tmp path is null"

    invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    invoke-static {p1, v0}, Les/la;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    :cond_1
    const/4 p1, 0x0

    .line 41
    iput-boolean p1, p0, Les/j9;->i:Z

    .line 42
    iget-object p1, p0, Les/j9;->x:Ljava/lang/Exception;

    if-eqz p1, :cond_2

    .line 43
    invoke-direct {p0}, Les/j9;->i()V

    goto :goto_4

    .line 44
    :cond_2
    invoke-direct {p0}, Les/j9;->g()V

    goto :goto_4

    .line 45
    :goto_3
    iput-object v0, p0, Les/j9;->c:Les/h9;

    .line 46
    throw p1
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    .line 47
    :cond_3
    :goto_4
    monitor-exit p0

    return-void

    :catchall_1
    move-exception p1

    monitor-exit p0

    goto :goto_6

    :goto_5
    throw p1

    :goto_6
    goto :goto_5
.end method

.method static synthetic b(Les/j9;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Les/j9;->v:Z

    return p0
.end method

.method static synthetic c(Les/j9;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Les/j9;->h()V

    return-void
.end method

.method static synthetic d(Les/j9;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Les/j9;->k()V

    return-void
.end method

.method static synthetic e(Les/j9;)Les/h9;
    .locals 0

    .line 1
    iget-object p0, p0, Les/j9;->c:Les/h9;

    return-object p0
.end method

.method private f()V
    .locals 2

    .line 2
    iget-object v0, p0, Les/j9;->t:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 3
    new-instance v0, Ljava/io/File;

    iget-object v1, p0, Les/j9;->t:Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/io/File;)Z

    .line 4
    new-instance v0, Ljava/io/File;

    iget-object v1, p0, Les/j9;->t:Ljava/lang/String;

    invoke-static {v1}, Les/q9;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/io/File;)Z

    :cond_0
    return-void
.end method

.method static synthetic f(Les/j9;)Z
    .locals 0

    .line 1
    invoke-direct {p0}, Les/j9;->j()Z

    move-result p0

    return p0
.end method

.method private g()V
    .locals 1

    .line 1
    invoke-direct {p0}, Les/j9;->f()V

    .line 2
    iget-object v0, p0, Les/j9;->n:Les/j9$b;

    invoke-interface {v0}, Les/j9$b;->b()V

    return-void
.end method

.method private declared-synchronized h()V
    .locals 2

    monitor-enter p0

    .line 1
    :try_start_0
    iget v0, p0, Les/j9;->h:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Les/j9;->h:I

    .line 2
    iget v1, p0, Les/j9;->g:I

    if-lez v1, :cond_0

    iget v1, p0, Les/j9;->g:I

    if-ne v0, v1, :cond_0

    .line 3
    iget-object v0, p0, Les/j9;->n:Les/j9$b;

    invoke-interface {v0}, Les/j9$b;->d()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 4
    :cond_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private i()V
    .locals 5

    .line 1
    iget-object v0, p0, Les/j9;->x:Ljava/lang/Exception;

    if-eqz v0, :cond_1

    .line 2
    iget v0, p0, Les/j9;->m:I

    iget v1, p0, Les/j9;->f:I

    if-eq v0, v1, :cond_0

    .line 3
    invoke-direct {p0}, Les/j9;->f()V

    goto :goto_0

    .line 4
    :cond_0
    iget-object v0, p0, Les/j9;->k:Les/l9;

    .line 5
    :goto_0
    iget-object v0, p0, Les/j9;->n:Les/j9$b;

    const/4 v1, 0x0

    const-wide/16 v2, 0x0

    iget-object v4, p0, Les/j9;->x:Ljava/lang/Exception;

    invoke-interface {v0, v1, v2, v3, v4}, Les/j9$b;->a(Ljava/lang/String;JLjava/lang/Exception;)V

    :cond_1
    return-void
.end method

.method private declared-synchronized j()Z
    .locals 3

    monitor-enter p0

    :try_start_0
    const-string v0, "MediaMuxerWrapper"

    const-string v1, "start:"

    .line 1
    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 2
    iget v0, p0, Les/j9;->g:I

    const/4 v1, 0x1

    add-int/2addr v0, v1

    iput v0, p0, Les/j9;->g:I

    .line 3
    iget v2, p0, Les/j9;->f:I

    if-lez v2, :cond_1

    iget v2, p0, Les/j9;->f:I

    if-ne v0, v2, :cond_1

    .line 4
    iget-object v0, p0, Les/j9;->c:Les/h9;

    if-eqz v0, :cond_0

    .line 5
    iget-object v0, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v0}, Les/h9;->b()V

    .line 6
    iput-boolean v1, p0, Les/j9;->i:Z

    .line 7
    :cond_0
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V

    const-string v0, "MediaMuxerWrapper"

    const-string v1, "MediaMuxer started:"

    .line 8
    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 9
    iget-boolean v0, p0, Les/j9;->s:Z

    invoke-virtual {p0, v0}, Les/j9;->a(Z)V

    .line 10
    :cond_1
    iget-boolean v0, p0, Les/j9;->i:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private declared-synchronized k()V
    .locals 8

    monitor-enter p0

    :try_start_0
    const-string v0, "MediaMuxerWrapper"

    .line 1
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "stop:mStartedCount="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v2, p0, Les/j9;->g:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 2
    iget v0, p0, Les/j9;->g:I

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    iput v0, p0, Les/j9;->g:I

    .line 3
    iget v2, p0, Les/j9;->f:I

    if-lez v2, :cond_9

    if-gtz v0, :cond_9

    .line 4
    iget-object v0, p0, Les/j9;->c:Les/h9;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    :try_start_1
    const-string v2, "MediaMuxerWrapper"

    const-string v3, "stop release!!!!!!"

    .line 5
    invoke-static {v2, v3}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 6
    iget-object v2, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v2}, Les/h9;->c()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 7
    :try_start_2
    iget-object v2, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v2}, Les/h9;->a()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    goto :goto_0

    :catch_0
    move-exception v2

    :try_start_3
    const-string v3, "MediaMuxerWrapper"

    const-string v4, "failed releasing muxer"

    .line 8
    invoke-static {v3, v4, v2}, Lcom/esfile/screen/recorder/media/util/k;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 9
    :goto_0
    iput-object v0, p0, Les/j9;->c:Les/h9;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    goto :goto_3

    :catchall_0
    move-exception v1

    goto :goto_1

    :catch_1
    move-exception v2

    :try_start_4
    const-string v3, "MediaMuxerWrapper"

    const-string v4, "failed stopping muxer"

    .line 10
    invoke-static {v3, v4, v2}, Lcom/esfile/screen/recorder/media/util/k;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 11
    :try_start_5
    iget-object v2, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v2}, Les/h9;->a()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2
    .catchall {:try_start_5 .. :try_end_5} :catchall_1

    goto :goto_0

    :catch_2
    move-exception v2

    :try_start_6
    const-string v3, "MediaMuxerWrapper"

    const-string v4, "failed releasing muxer"

    .line 12
    invoke-static {v3, v4, v2}, Lcom/esfile/screen/recorder/media/util/k;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_1

    goto :goto_0

    .line 13
    :goto_1
    :try_start_7
    iget-object v2, p0, Les/j9;->c:Les/h9;

    invoke-virtual {v2}, Les/h9;->a()V
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_3
    .catchall {:try_start_7 .. :try_end_7} :catchall_1

    goto :goto_2

    :catch_3
    move-exception v2

    :try_start_8
    const-string v3, "MediaMuxerWrapper"

    const-string v4, "failed releasing muxer"

    .line 14
    invoke-static {v3, v4, v2}, Lcom/esfile/screen/recorder/media/util/k;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 15
    :goto_2
    iput-object v0, p0, Les/j9;->c:Les/h9;

    .line 16
    throw v1

    .line 17
    :cond_0
    :goto_3
    iget-boolean v0, p0, Les/j9;->i:Z

    if-eqz v0, :cond_8

    .line 18
    iget-boolean v0, p0, Les/j9;->w:Z

    const/4 v2, 0x0

    if-eqz v0, :cond_1

    const-string v0, "MediaMuxerWrapper"

    const-string v1, "MediaMuxer cancelled:"

    .line 19
    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 20
    invoke-direct {p0}, Les/j9;->g()V

    goto/16 :goto_7

    :cond_1
    const-string v0, "MediaMuxerWrapper"

    .line 21
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "stop notify "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v4, p0, Les/j9;->m:I

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v4, " "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v4, p0, Les/j9;->f:I

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v4, " hasError:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, p0, Les/j9;->x:Ljava/lang/Exception;

    if-eqz v4, :cond_2

    const/4 v4, 0x1

    goto :goto_4

    :cond_2
    const/4 v4, 0x0

    :goto_4
    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v0, v3}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 22
    iget v0, p0, Les/j9;->m:I

    iget v3, p0, Les/j9;->f:I

    if-ne v0, v3, :cond_5

    .line 23
    new-instance v0, Ljava/io/File;

    iget-object v3, p0, Les/j9;->u:Ljava/lang/String;

    invoke-direct {v0, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/io/File;)Z

    .line 24
    iget-object v0, p0, Les/j9;->t:Ljava/lang/String;

    iget-object v3, p0, Les/j9;->u:Ljava/lang/String;

    invoke-static {v0, v3}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 25
    iget-object v0, p0, Les/j9;->n:Les/j9$b;

    iget-object v3, p0, Les/j9;->u:Ljava/lang/String;

    iget-wide v4, p0, Les/j9;->q:J

    iget-wide v6, p0, Les/j9;->r:J

    .line 26
    invoke-static {v4, v5, v6, v7}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v4

    iget-object v6, p0, Les/j9;->x:Ljava/lang/Exception;

    .line 27
    invoke-interface {v0, v3, v4, v5, v6}, Les/j9$b;->a(Ljava/lang/String;JLjava/lang/Exception;)V

    .line 28
    invoke-direct {p0}, Les/j9;->f()V

    .line 29
    iget v0, p0, Les/j9;->f:I

    if-le v0, v1, :cond_7

    iget-wide v0, p0, Les/j9;->o:J

    iget-wide v3, p0, Les/j9;->p:J

    sub-long/2addr v0, v3

    invoke-static {v0, v1}, Ljava/lang/Math;->abs(J)J

    move-result-wide v0

    const-wide/32 v3, 0x1e8480

    cmp-long v5, v0, v3

    if-lez v5, :cond_7

    .line 30
    new-instance v0, Lcom/esfile/screen/recorder/media/util/ExceptionUtil$AVSyncException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "a("

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v3, p0, Les/j9;->p:J

    const-wide/16 v5, 0x3e8

    div-long/2addr v3, v5

    invoke-virtual {v1, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v3, ") v("

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v3, p0, Les/j9;->o:J

    div-long/2addr v3, v5

    invoke-virtual {v1, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v3, ") sync failed."

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/esfile/screen/recorder/media/util/ExceptionUtil$AVSyncException;-><init>(Ljava/lang/String;)V

    invoke-static {v0}, Les/la;->a(Ljava/lang/Throwable;)V

    goto :goto_6

    .line 31
    :cond_3
    new-instance v0, Ljava/io/IOException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "save file failed. "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v3, p0, Les/j9;->u:Ljava/lang/String;

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " <tmp file("

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v3, p0, Les/j9;->t:Ljava/lang/String;

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, ")"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    new-instance v3, Ljava/io/File;

    iget-object v4, p0, Les/j9;->t:Ljava/lang/String;

    invoke-direct {v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 32
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v3

    if-eqz v3, :cond_4

    const-string v3, ""

    goto :goto_5

    :cond_4
    const-string v3, " not"

    :goto_5
    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " exists>"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    .line 33
    invoke-direct {p0, v0}, Les/j9;->a(Ljava/lang/Exception;)V

    .line 34
    invoke-direct {p0}, Les/j9;->i()V

    goto :goto_6

    .line 35
    :cond_5
    iget-object v0, p0, Les/j9;->x:Ljava/lang/Exception;

    if-eqz v0, :cond_6

    .line 36
    invoke-direct {p0}, Les/j9;->i()V

    goto :goto_6

    .line 37
    :cond_6
    invoke-direct {p0}, Les/j9;->g()V

    :cond_7
    :goto_6
    const-string v0, "MediaMuxerWrapper"

    const-string v1, "MediaMuxer stopped:"

    .line 38
    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 39
    :goto_7
    iput-boolean v2, p0, Les/j9;->i:Z

    goto :goto_8

    .line 40
    :cond_8
    invoke-direct {p0}, Les/j9;->g()V
    :try_end_8
    .catchall {:try_start_8 .. :try_end_8} :catchall_1

    .line 41
    :cond_9
    :goto_8
    monitor-exit p0

    return-void

    :catchall_1
    move-exception v0

    monitor-exit p0

    goto :goto_a

    :goto_9
    throw v0

    :goto_a
    goto :goto_9
.end method


# virtual methods
.method public a(Les/l9;)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalStateException;,
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    if-eqz p1, :cond_6

    .line 23
    invoke-virtual {p1}, Les/l9;->h()Z

    move-result v0

    if-nez v0, :cond_1

    .line 24
    iget-object v0, p0, Les/j9;->k:Les/l9;

    if-nez v0, :cond_0

    .line 25
    iput-object p1, p0, Les/j9;->k:Les/l9;

    .line 26
    iget-object v0, p0, Les/j9;->C:Les/l9$h;

    invoke-virtual {p1, v0}, Les/l9;->a(Les/l9$h;)V

    goto :goto_0

    .line 27
    :cond_0
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string v0, "Video source already added."

    invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 28
    :cond_1
    invoke-virtual {p1}, Les/l9;->h()Z

    move-result v0

    if-eqz v0, :cond_5

    .line 29
    iget-object v0, p0, Les/j9;->l:Les/l9;

    if-nez v0, :cond_4

    .line 30
    iput-object p1, p0, Les/j9;->l:Les/l9;

    .line 31
    iget-object v0, p0, Les/j9;->C:Les/l9$h;

    invoke-virtual {p1, v0}, Les/l9;->a(Les/l9$h;)V

    .line 32
    :goto_0
    iget-object p1, p0, Les/j9;->k:Les/l9;

    const/4 v0, 0x1

    const/4 v1, 0x0

    if-eqz p1, :cond_2

    const/4 p1, 0x1

    goto :goto_1

    :cond_2
    const/4 p1, 0x0

    :goto_1
    iget-object v2, p0, Les/j9;->l:Les/l9;

    if-eqz v2, :cond_3

    goto :goto_2

    :cond_3
    const/4 v0, 0x0

    :goto_2
    add-int/2addr p1, v0

    iput p1, p0, Les/j9;->f:I

    return-void

    .line 33
    :cond_4
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string v0, "Audio source already added."

    invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 34
    :cond_5
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "unsupported source"

    invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 35
    :cond_6
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "source cannot be null"

    invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public a(Ljava/lang/String;)V
    .locals 1

    .line 20
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, ".mp4"

    invoke-virtual {p1, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 21
    iput-object p1, p0, Les/j9;->u:Ljava/lang/String;

    return-void

    .line 22
    :cond_0
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "The path cannot be null and must end with .mp4"

    invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public declared-synchronized a(Z)V
    .locals 3

    monitor-enter p0

    :try_start_0
    const-string v0, "MediaMuxerWrapper"

    .line 7
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "setAudioON "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 8
    iput-boolean p1, p0, Les/j9;->s:Z

    .line 9
    iget-object v0, p0, Les/j9;->l:Les/l9;

    if-eqz v0, :cond_1

    if-eqz p1, :cond_0

    .line 10
    iget-object p1, p0, Les/j9;->l:Les/l9;

    invoke-virtual {p1}, Les/l9;->t()V

    goto :goto_0

    .line 11
    :cond_0
    iget-object p1, p0, Les/j9;->l:Les/l9;

    invoke-virtual {p1}, Les/l9;->s()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 12
    :cond_1
    :goto_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized a(ZLcom/esfile/screen/recorder/media/util/l;)V
    .locals 0

    monitor-enter p0

    if-eqz p1, :cond_1

    .line 13
    :try_start_0
    iget-object p1, p0, Les/j9;->l:Les/l9;

    if-eqz p1, :cond_0

    .line 14
    iget-object p1, p0, Les/j9;->l:Les/l9;

    invoke-virtual {p1, p2}, Les/l9;->b(Lcom/esfile/screen/recorder/media/util/l;)V

    goto :goto_0

    .line 15
    :cond_0
    invoke-virtual {p2}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    goto :goto_0

    .line 16
    :cond_1
    iget-object p1, p0, Les/j9;->k:Les/l9;

    if-eqz p1, :cond_2

    .line 17
    iget-object p1, p0, Les/j9;->k:Les/l9;

    invoke-virtual {p1, p2}, Les/l9;->b(Lcom/esfile/screen/recorder/media/util/l;)V

    goto :goto_0

    .line 18
    :cond_2
    invoke-virtual {p2}, Lcom/esfile/screen/recorder/media/util/l;->a()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 19
    :goto_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized a()Z
    .locals 1

    monitor-enter p0

    .line 6
    :try_start_0
    iget-boolean v0, p0, Les/j9;->i:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public b()V
    .locals 3

    .line 14
    iget-object v0, p0, Les/j9;->y:Ljava/lang/Object;

    monitor-enter v0

    .line 15
    :try_start_0
    iget-boolean v1, p0, Les/j9;->j:Z

    if-eqz v1, :cond_0

    .line 16
    monitor-exit v0

    return-void

    :cond_0
    const/4 v1, 0x1

    .line 17
    iput-boolean v1, p0, Les/j9;->j:Z

    .line 18
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 19
    monitor-enter p0

    .line 20
    :try_start_1
    iget v0, p0, Les/j9;->m:I

    iget v2, p0, Les/j9;->f:I

    if-eq v0, v2, :cond_1

    .line 21
    iput-boolean v1, p0, Les/j9;->z:Z

    .line 22
    monitor-exit p0

    return-void

    :cond_1
    const/4 v0, 0x0

    .line 23
    iput-boolean v0, p0, Les/j9;->z:Z

    .line 24
    iget-object v0, p0, Les/j9;->k:Les/l9;

    if-eqz v0, :cond_2

    .line 25
    iget-object v0, p0, Les/j9;->k:Les/l9;

    invoke-virtual {v0}, Les/l9;->m()V

    .line 26
    :cond_2
    iget-object v0, p0, Les/j9;->l:Les/l9;

    if-eqz v0, :cond_3

    .line 27
    iget-object v0, p0, Les/j9;->l:Les/l9;

    invoke-virtual {v0}, Les/l9;->m()V

    .line 28
    :cond_3
    iget-object v0, p0, Les/j9;->n:Les/j9$b;

    invoke-interface {v0}, Les/j9$b;->c()V

    .line 29
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0

    :catchall_1
    move-exception v1

    .line 30
    :try_start_2
    monitor-exit v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    throw v1
.end method

.method public c()Z
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 2
    iget-object v0, p0, Les/j9;->u:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_6

    .line 3
    iget-object v0, p0, Les/j9;->c:Les/h9;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    .line 4
    invoke-virtual {v0}, Les/h9;->a()V

    .line 5
    iput-object v1, p0, Les/j9;->c:Les/h9;

    :cond_0
    const/4 v0, 0x0

    .line 6
    iput v0, p0, Les/j9;->m:I

    .line 7
    iput-boolean v0, p0, Les/j9;->i:Z

    .line 8
    iput-boolean v0, p0, Les/j9;->v:Z

    .line 9
    iput-boolean v0, p0, Les/j9;->w:Z

    .line 10
    iput-object v1, p0, Les/j9;->x:Ljava/lang/Exception;

    .line 11
    iget-object v1, p0, Les/j9;->k:Les/l9;

    if-nez v1, :cond_2

    iget-object v1, p0, Les/j9;->l:Les/l9;

    if-eqz v1, :cond_1

    goto :goto_0

    :cond_1
    const/4 v1, 0x0

    goto :goto_1

    :cond_2
    :goto_0
    const/4 v1, 0x1

    .line 12
    :goto_1
    iget-object v2, p0, Les/j9;->k:Les/l9;

    if-eqz v2, :cond_3

    .line 13
    invoke-virtual {v2}, Les/l9;->n()Z

    move-result v1

    :cond_3
    if-eqz v1, :cond_4

    .line 14
    iget-object v2, p0, Les/j9;->l:Les/l9;

    if-eqz v2, :cond_4

    .line 15
    invoke-virtual {v2}, Les/l9;->n()Z

    move-result v1

    :cond_4
    const-string v2, "MediaMuxerWrapper"

    if-eqz v1, :cond_5

    .line 16
    iget-object v3, p0, Les/j9;->u:Ljava/lang/String;

    invoke-direct {p0, v3}, Les/j9;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    iput-object v3, p0, Les/j9;->t:Ljava/lang/String;

    .line 17
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "tmp path: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, p0, Les/j9;->t:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 18
    new-instance v2, Ljava/io/File;

    iget-object v3, p0, Les/j9;->t:Ljava/lang/String;

    invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 19
    invoke-virtual {v2}, Ljava/io/File;->getParent()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/lang/String;)Z

    .line 20
    invoke-static {v2}, Lcom/esfile/screen/recorder/media/util/j;->a(Ljava/io/File;)Z

    .line 21
    new-instance v2, Les/h9;

    iget-object v3, p0, Les/j9;->t:Ljava/lang/String;

    iget-boolean v4, p0, Les/j9;->b:Z

    invoke-direct {v2, v3, v0, v4}, Les/h9;-><init>(Ljava/lang/String;IZ)V

    iput-object v2, p0, Les/j9;->c:Les/h9;

    .line 22
    iget-boolean v0, p0, Les/j9;->a:Z

    invoke-virtual {v2, v0}, Les/h9;->a(Z)V

    .line 23
    iget-object v0, p0, Les/j9;->c:Les/h9;

    iget-wide v2, p0, Les/j9;->d:J

    invoke-virtual {v0, v2, v3}, Les/h9;->a(J)V

    .line 24
    iget-object v0, p0, Les/j9;->c:Les/h9;

    iget-boolean v2, p0, Les/j9;->e:Z

    invoke-virtual {v0, v2}, Les/h9;->b(Z)V

    goto :goto_2

    :cond_5
    const-string v0, "prepare sources failed"

    .line 25
    invoke-static {v2, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    :goto_2
    return v1

    .line 26
    :cond_6
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "You must set path first!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public declared-synchronized d()V
    .locals 4

    monitor-enter p0

    .line 2
    :try_start_0
    iget-object v0, p0, Les/j9;->c:Les/h9;

    if-eqz v0, :cond_2

    .line 3
    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    div-long/2addr v0, v2

    .line 4
    iget-object v2, p0, Les/j9;->k:Les/l9;

    if-eqz v2, :cond_0

    .line 5
    iget-object v2, p0, Les/j9;->k:Les/l9;

    invoke-virtual {v2, v0, v1}, Les/l9;->a(J)V

    .line 6
    :cond_0
    iget-object v2, p0, Les/j9;->l:Les/l9;

    if-eqz v2, :cond_1

    .line 7
    iget-object v2, p0, Les/j9;->l:Les/l9;

    invoke-virtual {v2, v0, v1}, Les/l9;->a(J)V

    .line 8
    :cond_1
    iget-object v0, p0, Les/j9;->n:Les/j9$b;

    invoke-interface {v0}, Les/j9$b;->a()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 9
    monitor-exit p0

    return-void

    .line 10
    :cond_2
    :try_start_1
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "You must prepare first!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized e()V
    .locals 2

    monitor-enter p0

    const/4 v0, 0x1

    .line 2
    :try_start_0
    iput-boolean v0, p0, Les/j9;->v:Z

    .line 3
    iget-object v0, p0, Les/j9;->k:Les/l9;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    .line 4
    iget-object v0, p0, Les/j9;->k:Les/l9;

    invoke-virtual {v0}, Les/l9;->q()V

    .line 5
    iput-object v1, p0, Les/j9;->k:Les/l9;

    .line 6
    :cond_0
    iget-object v0, p0, Les/j9;->l:Les/l9;

    if-eqz v0, :cond_1

    .line 7
    iget-object v0, p0, Les/j9;->l:Les/l9;

    invoke-virtual {v0}, Les/l9;->q()V

    .line 8
    iput-object v1, p0, Les/j9;->l:Les/l9;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 9
    :cond_1
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
